package flirtme.model;

import java.util.Date;

public class Message extends BaseMessage{

	private ContactModel sender;
	private ContactModel receiver;
	
	public Message() {
	}
	
	public Message(String content, ContactModel sender, ContactModel Receiver)
	{
		this.content = content;
		this.sender = sender;
		this.receiver = Receiver;
		this.timestamp = new Date();
	}

	public Message(Long id) {
		this.id = id;
	}

	public ContactModel getSender() {
		return sender;
	}

	public void setSender(ContactModel sender) {
		this.sender = sender;
	}

	public ContactModel getReceiver() {
		return receiver;
	}

	public void setReceiver(ContactModel receiver) {
		this.receiver = receiver;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Message other = (Message) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}	
}
